﻿using UnityEngine;
using System;
using System.Collections.Generic;

public class WarSceneObject
{
    #region 成员变量
    /// <summary>
    /// 移动目标
    /// </summary>
    WarSceneObject mMoveTarget;
    
    #endregion

    virtual public void breath(float deltTime)
    { 
        // move
    }

    public bool needDestroy()
    {
        return false;
    }

    void onPositionChanged()
    {
        if (this.OnPositionChanged != null)
        {
            OnPositionChanged();
        }
    }

    protected void moveBreath(float deltTime)
    {
        float speed = Speed;
        if (Direction == WarSceneBlockDirction.RIGHT)
        {
            speed = Speed * -1;
        }
        WarSceneBlock block = mMoveTarget.CurrSceneBlock;

    }
    /// <summary>
    /// 是否能往前走
    /// </summary>
    /// <returns></returns>
    protected bool canMoveForward()
    {
        return false;
    }
    #region 属性
    /// <summary>
    /// ID
    /// </summary>
    public int ID{get; private set;}
    /// <summary>
    /// 位置信息
    /// </summary>
    public Vector2 Position{get; set; }
    /// <summary>
    /// 当前格子
    /// </summary>
    public WarSceneBlock CurrSceneBlock{get; private set;}
    /// <summary>
    /// 朝向
    /// </summary>
    public WarSceneBlockDirction Direction { get; private set;}
    /// <summary>
    /// 类型(陆地/飞行)
    /// </summary>
    public WarSceneObjectType BlockType { get; private set; }
    /// <summary>
    /// 速度
    /// </summary>
    public float Speed { get; private set;}
    #endregion

    #region Deleget

    public EOnPositionChanged OnPositionChanged = null;
    
    
    public delegate void EOnPositionChanged();

    #endregion
}
